#pragma once
#include<osgDB/Registry>

class Debug {
public:
	static void checkSupported3DFormats() {
		std::vector<std::string> testedExtensions = {
			// OpenSceneGraph native
			"osg", "osgb", "osgt", "ive",
			// common 3d format
			"obj", "stl", "ply", "3ds", "fbx", "dae", "gltf", "glb",
			"x",       // DirectX
			"blend",   // Blender
			"usd", "usda", "usdc", "usdz", // Pixar USD
			"abc",     // Alembic
			"vrml", "wrl", "wrz",        // VRML
			"x3d",                       // X3D
			"ifc",                       // Industry Foundation Classes (BIM)
			"bvh",                       // Motion capture
			"md2", "md3",                // Quake
			"lwo",                       // Lightwave Object
			"ac",                        // AC3D format
			"cob",                       // Caligari Object
			"xsi",                       // Softimage
			"3mf",                       // 3D Manufacturing Format
			"g",                         // OpenGEX
		};

		std::vector<std::string> supportedExts, unsupportedExts;

		for (const auto& ext : testedExtensions) {
			osgDB::ReaderWriter* rw = osgDB::Registry::instance()->getReaderWriterForExtension(ext);
			if (rw) {
				auto s = ext + " (";
				s += rw->className();
				s += ")";
				supportedExts.push_back(s);
			} else
				unsupportedExts.push_back(ext);
		}
		std::cout << "********************************************" << std::endl;
		std::cout << "++++++ supported formats:" << std::endl;
		for (auto& ext : supportedExts)
			std::cout << ext << std::endl;
		std::cout << "------ unsupported formats:" << std::endl;
		for (auto& ext : unsupportedExts)
			std::cout << ext << " ";
		std::cout << "\n********************************************\n" << std::endl;
	}
};